﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.DS
{
    public static partial class problem
    {
        public static dynamic getDSProblemCompleteInfo(int eid, int pid)
        {
            var sql = new Sql.SqlDataContext();
            var p = sql.DSProblem.FirstOrDefault(row => row.eid == eid && row.pid == pid);
            if (p == null) return new
            {
                success = false,
                msg = "题目不存在"
            };

            return new
            {
                success = true,
                p.eid,
                p.pid,
                p.title,
                p.timeLimit,
                p.memoryLimit,
                p.disabled,
                p.description,
                p.input,
                p.output,
                p.sampleInput,
                p.sampleOutput,
                p.hint,
                p.source,
                p.exampleLang,
                p.exampleCode,
                p.inputData,
                p.outputData,
                p.specialJudge,
                p.specialLang,
                p.specialCode
            };
        }
    }
}
